{% extends "base.html" %}

{% block title %}编辑系统配置 - 网站管理后台{% endblock %}

{% block content %}
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
    <h1 class="h2">编辑系统配置</h1>
</div>

<div class="row">
    <div class="col-md-6">
        <form method="POST">
            <div class="mb-3">
                <label for="key" class="form-label">键名</label>
                <input type="text" class="form-control" id="key" name="key" value="{{ config[1] }}" readonly>
            </div>
            <div class="mb-3">
                <label for="value" class="form-label">键值</label>
                <input type="text" class="form-control" id="value" name="value" value="{{ config[2] }}" required>
            </div>
            <div class="mb-3">
                <label for="description" class="form-label">描述</label>
                <textarea class="form-control" id="description" name="description" rows="3">{{ config[3] if config[3] else '' }}</textarea>
            </div>
            <div class="mb-3">
                <label for="category" class="form-label">分类</label>
                <input type="text" class="form-control" id="category" name="category" value="{{ config[4] if config[4] else '' }}">
            </div>
            <button type="submit" class="btn btn-primary">更新配置</button>
            <a href="{{ url_for('web.system_configs') }}" class="btn btn-secondary">取消</a>
        </form>
    </div>
</div>
{% endblock %}